﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ShowBook.aspx.cs" Inherits="TeachingManageSystem.Web.ShowBook" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
       
        .style2
        {
            width: 11%;
        }
       
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DataList ID="DataList1" runat="server" DataKeyField="Number" 
        BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" GridLines="Both" Width="100%" 
                ondeletecommand="DataList1DeleteCommand" >
        <AlternatingItemStyle BackColor="#DCDCDC" />
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#669999" Font-Bold="True" ForeColor="White" 
                    HorizontalAlign="Left" VerticalAlign="Top" />
                <HeaderTemplate>
                    <table class="style1">
                        <tr>
                           <td style="width: 13%">
                                &nbsp;教材图片</td>
                             <td class="style2">
                                教材编号</td>
                            <td class="style2">
                                教材名</td>
                             <td class="style2">
                                出版社</td>
                             <td class="style2">
                                出版时间</td>
                             <td class="style2">
                                作者</td>
                             <td class="style2">
                                单价</td>
                            <td class="style2">
                                类别</td>
                             <td class="style2">
                                备注</td>
                           <td >
                                &nbsp;</td>
                        </tr>
                    </table>
                </HeaderTemplate>
        <ItemStyle BackColor="#EEEEEE" ForeColor="Black" />
        <ItemTemplate>
           <table>
                <tr>
                    <td style="width: 13%">
                    <a href="DetailOrEditBook.aspx?booknumber=<%#Eval("Number")%>&ImageID=<%#Eval("PictureID")%>"><img src='<%# Eval("PictureID", "ShowImage.aspx?ImageID={0}") %>' style="height: 101px; width: 114px" alt=""/> </a>
                    </td>
                    <td style="width: 8%">
                        <asp:Label ID="NumberLabel" runat="server" Text='<%# Eval("Number") %>' />
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="PublisherLabel" runat="server" Text='<%# Eval("Publisher") %>' />
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="PublistedTimeLabel" runat="server" 
                            Text='<%#Convert.ToDateTime(Eval("PublistedTime")).ToString("yyyy-MM") %>' />
                           
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="PriceLabel" runat="server" Text='<%#Eval("Price")%>'/>
                    </td>
                          <td style="width: 10%">
                              &nbsp;<asp:Label ID="BookTypeIDLabel" runat="server" 
                                  Text='<%# GetBookTypeName((int) Eval("BookTypeID")) %>' />
                    </td>  
                    <td style="width: 10%">
                        <asp:Label ID="RemarkLabel" runat="server" Text='<%# Eval("Remark") %>' />
                        <br/>
                         <asp:LinkButton ID="LbtDeleteBook" runat="server" CommandName="Delete" CausesValidation="False"
                                        Text="删除" CommandArgument='<%#Eval("BookTypeID") %>'></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
        <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    </asp:DataList>
    <table class="style1">
                <tr>
                    <td>
                        <asp:LinkButton ID="LbtFirstPage" OnCommand="IndexChanging" CommandArgument="first" runat="server">首页</asp:LinkButton>
                    </td>
                    <td>
                        <asp:LinkButton ID="LbtPrePage" OnCommand="IndexChanging" CommandArgument="pre" runat="server">上一页</asp:LinkButton>
                    </td>
                    <td>
                        <asp:LinkButton ID="LbtNextPage" OnCommand="IndexChanging" CommandArgument="next" runat="server">下一页</asp:LinkButton>
                    </td>
                    <td>
                        <asp:LinkButton ID="LbtLastPage" OnCommand="IndexChanging" CommandArgument="last" runat="server">末页</asp:LinkButton>
                    </td>
                    <td>
                        当前页：<asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink>
                    </td>
                    <td>
                        总共 
                        <asp:HyperLink ID="HyperLink2" runat="server">HyperLink</asp:HyperLink>
                        &nbsp;页</td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    </asp:Content>
